package cn.unuuc.cwl.account.controller;

import cn.unuuc.cwl.account.model.qo.AccountQo;
import cn.unuuc.cwl.account.service.AccountService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RequestMapping("account")
@RestController
public class AccountController {

    @Resource
    private AccountService accountService;

    /**
     * 扣减账户余额
     */
    @PostMapping
    public String deductMoney(@RequestBody AccountQo accountQo) {
        accountService.deductMoney(accountQo);
        return "扣款成功";
    }
}
